package compare;

class MyClass implements Comparable{
	private float data;
	public MyClass(float data_in){
		data = data_in;
	}
	@Override
	public int compareTo(Object o) {
		MyClass other = (MyClass) o;
		int difference = (int)( this.data - other.data );
		return difference;
	}
}
public class Comparing {

	public static void main(String[] args) {
		MyClass a = new MyClass( 110.0f );
		MyClass b = new MyClass( 110.1f );
		
		System.out.println(" a.compareTo(b) is " + a.compareTo(b) );
		
	}

}
